package Chapter22.CollectionsMethod;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class MaxAndMin {
    public static void main(String[] args) {
        Collection<String> collection = Arrays.asList("red", "green", "blue");
        List<Integer> list = Arrays.asList(59, 50, 7, 4, 10, 11, 66, 45, 60, 2);

        System.out.println(Collections.max(collection));
        System.out.println(Collections.min(collection));
        System.out.println("===================");
        System.out.println(Collections.max(list));
        System.out.println(Collections.min(list));
    }
}
